package test.service;

import test.testcase.Project;
import test.testcase.dao.projectDao;
import test.utils.JsonResult;

public class ServiceProject {
	
	public static Project getProjectFromJobId(String jobid) {
		JsonResult result =projectDao.getProjectFromJobId(jobid);
		Project project = new Project();
		project.setId(result.read("data[0].id").toString());
		project.setPreurl(result.read("data[0].preurl").toString());
		project.setProjectname(result.read("data[0].projectname").toString());
		return project;
	}
	
	public static Project getProject(String projectid) {
		JsonResult result = projectDao.getProject(projectid);
		Project project = new Project();
		project.setId(result.read("data[0].id").toString());
		project.setPreurl(result.read("data[0].preurl").toString());
		project.setProjectname(result.read("data[0].projectname").toString());
		project.setType(result.read("data[0].type").toString());
		return project;
	}

}
